<template>
    <div>
        <div class="header">

        </div>
        <div class="main">
            <van-address-edit :area-list="areaList" show-postal show-delete show-set-default show-search-result
                :search-result="searchResult" :area-columns-placeholder="['请选择', '请选择', '请选择']" @save="onSave"
                @delete="onDelete" />
        </div>
    </div>
</template>

<script>
import { addRessAdd } from "../../api/my";
import { areaList } from '@vant/area-data';
import Vue from 'vue';
import { AddressEdit, Toast, Area } from 'vant';

Vue.use(AddressEdit);
Vue.use(Toast);
Vue.use(Area);
export default {
    data() {
        return {
            areaList,
            searchResult: [],
        }
    },
    methods: {
        onSave() {
            Toast('save');
            addRessAdd({ userid: localStorage.getItem("userid") }).then(res => {
                console.log(res);
            })

        },
        onDelete() {
            Toast('delete');
            this.$router.go(-1)
        },
    },

    created() {

    }
}
</script>

<style>

</style>